<template>
  <div>
    <div class="item"
      v-for="(item, index) of list"
      :key="index"
    >
      <div class="item-title border-bottom">
        <span class="item-title-icon"></span>
        {{item.title}}
      </div>
      <!-- 这里是二级列表，通过组件自己调用自己 -->
      <div v-if="item.children" class="item-chlidren">
        <detail-list :list="item.children"></detail-list>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DetailList',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
.item-title
  line-height .8rem
  padding: 0 .2rem
  font-size: .32rem
.item-title-icon
  position: relative
  left: .04rem
  top: .06rem
  display: inline-block
  width: .36rem
  height: .36rem
  text-indent: .5rem
  color: #14a0bb
  font-family: "Hiragino Sans GB","\5FAE\8F6F\96C5\9ED1",Arial,sans-serif
  background: url(http://img1.qunarzz.com/piao/fusion/1609/e6/78817571a82a1202.png) no-repeat
  background-position: 0 -48px
  margin-right: .1rem
.item-chlidren
  padding: 0 .2rem
</style>
